from django.db import models
from django.contrib.auth.models import User
# Create your models here.
class File(models.Model):
    name = models.CharField(max_length=255)
    size = models.CharField(max_length=255)
    type = models.CharField(max_length=255)
    upload_time = models.DateTimeField(auto_now_add=True)
    upload_user = models.ForeignKey(User, on_delete=models.CASCADE)
    file_path = models.FileField(upload_to='files/')
    share_code = models.CharField(max_length=255, blank=True, null=True)
    def __str__(self):
        return self.name